﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Beaup
{
    public partial class BeaupSignIn : Form
    {
        private LibMSNP.Client.MSNPClient _client;
        private const int _defaultTimeout = 10; // in seconds

        public BeaupSignIn()
        {
            InitializeComponent();
            _client = new LibMSNP.Client.MSNPClient(_defaultTimeout);
            _client.OnCommandReceived += new LibMSNP.Client.MSNPClient.MSNPCommandReceived(CommandReceived);
            _client.OnConnectionEstablished += new LibMSNP.Client.MSNPClient.MSNPClientConnected(ConnectionEstablished);
            _client.OnServerDisconnect += new LibMSNP.Client.MSNPClient.MSNPServerDisconnected(ServerDisconnected);
        }

        private void BeaupSignIn_Load(object sender, EventArgs e)
        {

        }

        private void CommandReceived(object sender, LibMSNP.Client.MSNPEventArgs e)
        {

        }

        private void ConnectionEstablished(object sender, LibMSNP.Client.MSNPEventArgs e)
        {
            MessageBox.Show("Connected");
        }

        private void ServerDisconnected(object sender, LibMSNP.Client.MSNPDisconnectArgs e)
        {

        }

        private void loginButton_Click(object sender, EventArgs e)
        {
            _client.Start(this.emailTextBox.Text, this.textBox1.Text);
        }
    }
}
